#ifndef __NVD1115_h__
#define __NVD1115_h__


/*------------------------------------------------------------------
include files or lib

*/
#include "mbed.h"


/*------------------------------------------------------------------
define

*/ 
#define PORT_A 0
#define PORT_B 1

/*------------------------------------------------------------------
class

*/

class NVD1115
{
    private:
    uint32_t FreqA;
    uint32_t FreqB;
    uint32_t PulseWidthA;
    uint32_t PulseWidthB;
    
    uint8_t (*_set_DirA)(void);
    uint8_t (*_reset_DirA)(void);
    uint8_t (*_set_DirB)(void);
    uint8_t (*_reset_DirB)(void);
    
    uint8_t (*_set_PeriodA)(uint32_t period);
    uint8_t (*_set_PeriodB)(uint32_t period);
    uint8_t (*_set_PulseWidthA)(uint32_t width);
    uint8_t (*_set_PulseWidthB)(uint32_t width);
    
    public:
    void begin(uint8_t(*__set_DirA)(void), uint8_t(*__reset_DirA)(void), uint8_t(*__set_DirB)(void), uint8_t(*__reset_DirB)(void), uint8_t(*__set_PeriodA)(uint32_t period),
                 uint8_t(*__set_PeriodB)(uint32_t period), uint8_t(*__set_PulseWidthA)(uint32_t width), uint8_t(*__set_PulseWidthB)(uint32_t width));
    uint8_t SetDirection(uint8_t port, uint8_t dir);
    uint8_t SetFrequence(uint8_t port, uint32_t freq);
    uint8_t SetSpeed(uint8_t port, uint32_t SpeedRatio);
};



#endif
